<template>
    <div id="CFTable">
      <table border="1">
        <thead>
          <tr>
            <th>商品id</th>
            <th>商品name</th>
            <th>商品num</th>
            <th>商品操作</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(item,index) in goods" :key="index">
            <td>{{item.g_no}}</td>
            <td>{{item.g_name}}</td>
            <td>{{item.g_num}}</td>
            <td>
              <button @click="delOne(item.g_no,index)">删除</button>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
</template>

<style lang="less" scoped>
#CFTable {
  text-align: center;
  table {
    width: 600px;
    margin: 0 auto;
  }
}
</style>

<script>
import axios from 'axios'
export default {
  props:['goods'],
  data(){
    return {
    }
  },
  methods: {
    delOne(no,index) {
      console.log('删除数据', '')
      this.$emit('del-goods',no,index)
    }
  }
}
</script>